package Spring.demo.controller;

import Spring.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller
public class UserController {


    @Autowired
    //@Qualifier(value = "user2")
    //@Resource(name = "user1")
    private User user;
    public void getUser()
    {
        System.out.println("user:"+user);
        User user2=user;
        user2.setName("lisi");
        System.out.println("user:"+user2);
    }

}
